//
//  IntroViewController.swift
//  xdjcy
//
//  Created by Henry on 15/12/17.
//  Copyright (c) 2015年 Henry. All rights reserved.
//

import UIKit

class IntroViewController: UIViewController,EAIntroDelegate{

    @IBOutlet var IntroView: EAIntroView!
    override func viewDidLoad() {
        super.viewDidLoad()

        var image1 = UIImageView(image: UIImage(named: "yd1"))
        var page1 = EAIntroPage(customView: image1)
        var image2 = UIImageView(image: UIImage(named: "yd2"))
        var page2 = EAIntroPage(customView: image2)
        var image3 = UIImageView(image: UIImage(named: "yd3"))
        var page3 = EAIntroPage(customView: image3)
        var image4 = UIImageView(image: UIImage(named: "yd4"))
        var page4 = EAIntroPage(customView: image4)
        
        
        IntroView.delegate = self
        IntroView.skipButton = nil
        IntroView.pages = [page1,page2,page3,page4]
        
        
        MenuTypeRN.sharedInstance.getAllTypes { (result, message, jwJosn, flJson, ajJson) -> Void in
            if result
            {
                BaseType.sharedInstance.jw_typeList = jwJosn
                BaseType.sharedInstance.fl_typeList = flJson
                BaseType.sharedInstance.aj_typeList = ajJson
                
                var tapgesture  = UITapGestureRecognizer(target: self, action: "tapHandler:")
                image4.userInteractionEnabled = true
                image4.addGestureRecognizer(tapgesture)


            }
        }

    }
    func tapHandler(sender:UITapGestureRecognizer) {
        
        self.performSegueWithIdentifier("jumpToHome", sender: self)
    }
    
    func introDidFinish(introView: EAIntroView!) {
        self.performSegueWithIdentifier("jumpToHome", sender: self)
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
